home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra / backgmmn.zip / BACK.H next >
C/C++ Source or Header  |  1995-02-16  |  2KB  |  79 lines

  1. /************************************************************************/
  2. /*  Hoser BackGammon version 1.0                    */
  3. /*    Robert Pfister                            */
  4. /*    Rfd#3 Box 2340        home:(207)-873-3520            */
  5. /*    Waterville, Maine 04901                        */
  6. /*                                    */
  7. /*    Pfister_rob%dneast@dec.decwrl                    */
  8. /*                                    */
  9. /*  Copyright  June,1987 all rights reserved.                */
  10. /*                                    */
  11. /*  This program will play a game of backgammon at the novice level    */
  12. /*                                    */
  13. /*  The code is in 4 parts...                        */
  14. /*     1) back.c     - main driver                    */
  15. /*   /   2) eval.c     - evaluation of moves                */
  16. /* \/     3) backscn.c  - screen stuff..                    */
  17. /*     4) backmenu.c - menu stuff, help text, and ``decoder''        */
  18. /*                                    */
  19. /* this was compiled under Manx 3.20a, using long integers        */
  20. /*                                    */
  21. /* This file contains global definitions for Hoser Backgammon        */
  22. /************************************************************************/
  23. /* Last modification:         1/ 3/92                */
  24. /* Most recent modification     5/16/94    E.M.Greene        */
  25. /* Most recent modification     2/14/95    E.M.Greene        */
  26.  
  27. #define Uside        -1
  28. #define Cside        1
  29. #undef  NULL
  30. #define NULL        ((void *) 0)
  31. #define NL        0
  32.  
  33. #define tm1_color    0
  34. #define tm2_color    1
  35. #define back_color    2
  36. #define spike1_color    3
  37. #define spike2_color    4
  38. #define piece1_color    5
  39. #define piece2_color    6
  40. #define dice_color    7
  41. #define PerSpike    5L
  42. #define sizeof_board    (26 * sizeof(BYTE))
  43.  
  44. #include <exec/types.h>
  45.  
  46. typedef
  47.   struct {
  48.     USHORT    incomplete,        /*    YouInc,        MeInc,    */
  49.         dice_total,        /*    YouD,        MeD,    */
  50.         moves,            /*    YouM,        MeM,    */
  51.         on_bar,            /*    YouBar,        MeBar,    */
  52.         doubles,        /*    You2,        Me2,    */
  53.         wasted;            /*    YouWasted;    MeWasted*/
  54.     struct {
  55.       ULONG    roll;
  56.       float    average_roll;
  57.       ULONG    incomplete,
  58.         wasted;} total;}    you_me_rec;
  59.  
  60. /* globally-referenced routines' definitions                */
  61.  
  62. void    DoMenuStrip(char *text);
  63. void    PutMoveNumber(int count);
  64. void    BlinkPiece(BYTE *board, int piece);
  65. int    update(BYTE *board, int from_point, int to_point, BYTE sign);
  66. void    PutSpike(int side, int board_pos);
  67. int    valid(BYTE *board,int i1, int i2, int die2);
  68. int    DoMenu(int menu_item);
  69. void    DoMenuStrip(char *s);
  70. void    UnDoMenuStrip(void);
  71. int    decode(int x, int y);
  72. void    Gsetup(void);
  73. void    ShowDice(BYTE *dice, int turn);
  74. void    finit(void);
  75. void    DoMove(BYTE *board, BYTE *dice);
  76. void    GenerateMoves(BYTE *board, BYTE *dice);
  77. void    TextScreen(char **text, int lines);
  78. BOOL    requestor(char name[], char yes[], char no[]);
  79.